<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link href="css/bootstrap.min.css" rel="stylesheet">
		<script type="text/javascript" src="../js/jquery.min.js"></script>
		
		<link rel="stylesheet" type="text/css" href="../css/login.css">
		<meta charset="UTF-8">
		<title></title>
		
		<script type="text/javascript">
			function addBook(){
				var bookMess=$("#addbook").serialize();
				$.ajax({
					type:"post",
					url:"http://localhost:8083/book/add",
					data:bookMess,
					dataType:"text",
					async:true,
					success:function(result){
						if(result=="true"){
							alert("恭喜，添加成功！")
							location.href="showBooks.html";
						}else{
							alert("添加失败，请重试！");
						}
					}
				});
			}
		</script>
	</head>
	<body>
		<div class="regist">
		<div class="regist_center">
			<div class="regist_top">
				<div class="left fl"></span>&nbsp;&nbsp;要添加的用户的信息</div>
				<div class="right fr">
					<a href="user.html" target="right">返回用户列表页面</a>
				</div>
				<div class="clear"></div>
				<div class="xian center"></div>
			</div>
			<div class="center-block" style="margin-top: 80px;">
				<form id="addbook" class="form-horizontal" action="userRegister" method="post">
					
					<div class="form-group">
						<label class="col-sm-2 control-label">请输入员工卡号</label>
						<div class="col-sm-8" style="width: 40%">
							<input type="text" id="username" name="idCard" class="form-control col-sm-10"
								placeholder="员工卡号" />
						</div>
						<div class="col-sm-2">
						<p class="text-danger"><span class="help-block " id="usernameMsg"></span></p>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">员工姓名</label>
						<div class="col-sm-8" style="width: 40%">
							<input type="text" id="price" name="price"
								class="form-control col-sm-10" placeholder="请输入员工姓名" />
						</div>
						
					</div>
					
					<div class="form-group">
						<label class="col-sm-2 control-label">密码</label>
						<div class="col-sm-8" style="width: 40%">
							<input type="text" id="email" name="publisher" class="form-control col-sm-10"
								placeholder="请输入密码" />
						</div>
						
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">请再次输入密码</label>
						<div class="col-sm-8" style="width: 40%">
							<input type="text" id="email" name="publisher" class="form-control col-sm-10"
								placeholder="请输入密码" />
						</div>
						
					</div>
					
					
					<hr>
					<div class="form-group">
						<div class="col-sm-7 col-sm-push-2">
							<input id="registerBtn" type="button" onclick="addBook()" value="添加" class="btn btn-primary  btn-lg" style="width: 200px;" /> &nbsp; &nbsp;
							<input type="reset" value="重置" class="btn btn-default  btn-lg" style="width: 200px;"  />
						</div>
					</div>
				
				</form>

			</div>
		</div>
	</div>
	
	</body>
</html>
